
******************************************************
** Balance Tests based on shock exposure
******************************************************

use "$datadir\ewallet\maindata.dta", clear
	
	keep if $filters & time_id==35
	
	local opt "bdec(3) excel nonotes noaster"
	reg l_preshockdeposit , robust cluster(district_id)
	outreg2 using "$outputdir_tab\Table_1_col1.xls", replace `opt' side 
	
	local covariates s_status_atm branch_pop credsoc_pop  s_status_commercialbank logpop_T literacy_rate sexratio growthrate_town2011  ///
	emp_rate distance_capital  share_rural   
	qui foreach var of varlist `covariates'{
		reg `var' , robust cluster(district_id)
		outreg2 using "$outputdir_tab\Table_1_col1.xls", append `opt' side
	}
	
	local indvar invshare_sd
	local opt "bdec(3) excel nonotes"
	reg l_preshockdeposit `indvar' , robust cluster(district_id)
	outreg2 using "$outputdir_tab\Table_1_col2.xls", replace `opt' side keep(`indvar')
	
	local covariates s_status_atm branch_pop credsoc_pop  s_status_commercialbank logpop_T literacy_rate sexratio growthrate_town2011  ///
	emp_rate distance_capital  share_rural  
	qui foreach var of varlist `covariates'{
		reg `var' `indvar' , robust cluster(district_id)
		outreg2 using "$outputdir_tab\Table_1_col2.xls", append `opt' side keep(`indvar')
	}
	
	local indvar invshare_sd
	reg branch_pop `indvar'  l_preshockdeposit s_status_atm, robust cluster(district_id)
	outreg2 using "$outputdir_tab\Table_1_col3.xls", replace `opt' side keep(`indvar')
			
	local covariates  credsoc_pop  s_status_commercialbank logpop_T literacy_rate sexratio growthrate_town2011  ///
	emp_rate distance_capital  share_rural  
	qui foreach var of varlist `covariates'{
		reg `var' `indvar' l_preshockdeposit  s_status_atm , robust cluster(district_id)
		outreg2 using "$outputdir_tab\Table_1_col3.xls", append `opt' side keep(`indvar')	
	}
	
	